/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <cstdlib>
#include <ctime>
using namespace std;
void show(auto &container)
{
    for(auto element:container)
    {
        cout << element << " ";
    }
    cout << endl;
}
int main_32()
{
    srand((unsigned int)time(nullptr));
    vector<int> int_vect;
    list<int> int_list;
    int random_int,range=20;
    for (int i=0; i<range ; ++i )
    {
        random_int=rand()%range;
        int_vect.push_back(random_int);
    }
    for (int i=0; i<3 ; ++i )
    {
        random_int=rand()%range;
        int_list.push_back(random_int);
    }
    cout << "vector" << endl;
    show(int_vect);
    sort(int_vect.begin(),int_vect.end());
    show(int_vect);
    random_int=rand()%range;
    bool isFound=binary_search(int_vect.begin(),int_vect.end(),random_int);
    if (isFound)
    {
        printf("find %d in the ascending order container.\n",random_int);
    }
    else
    {
        printf("Don't find %d in the ascending order container.\n",random_int);
    }
    cout << "list" << endl;
    show(int_list);
    int_list.sort();
    show(int_list);
    isFound=includes(int_vect.begin(),int_vect.end(),int_list.begin(),int_list.end());
    if (isFound)
    {
        printf("The sequence includes in the search range in order.\n");
    }
    else
    {
        printf("The sequence doesn't include in the search range in order.\n");
    }
    return 0;
}
